package com.gagakuai.bpm.common.enums;


import com.gagakuai.bpm.common.constants.BpmConsumeEnumConstants;

/*
 * @program: mss_server
 * @description: bpm业务消费类型
 * @author: houhong
 * @create: 2022-03-29 10:11
 */
public enum BpmConsumeEnum {


    WITH_DRAW_CONSUME("1", "撤销流程消费者", BpmConsumeEnumConstants.BPM_CONSUME_MAX_VALUE);


    /*
     * 编码
     */
    private String code;

    /*
     * 最大业务编号
     */
    private String maxCode;


    public String getMaxCode() {
        return maxCode;
    }

    public void setMaxCode(String maxCode) {
        this.maxCode = maxCode;
    }

    /*
     * 描述
     */
    private String description;

    BpmConsumeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    BpmConsumeEnum(String code, String description, String maxCode) {
        this.code = code;
        this.description = description;
        this.maxCode = maxCode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    /*
     * @param code 代码
     * @return {@link String}
     * @Author houhong
     * @Description //TODO 获取描述码
     */
    public static String getNameByCode(String code) {


        for (BpmConsumeEnum temp : BpmConsumeEnum.values()) {

            if (temp.getCode().equals(code)) {
                return temp.getDescription();
            }
        }
        return null;

    }
}